# Makefile para phFITS

CC = gcc
CPP = g++

CCFLAGS = -W -Wall -O2
CPPFLAGS = -W -Wall -O2

LIBSC = -lcfitsio -lm
LIBSCPP = -lCCfits -lm -lcfitsio -lstdc++

##

all: read

read: read.c write.c
	$(CC) $(CCFLAGS) $(LIBSC) -o $@ $<

debugC: read.c
	$(CC) $(CCCFLAGS) $(LIBSC) -D__DEBUG__ -o $@ $<

write: write.c
	$(CC) $(CCFLAGS) $(LIBSC) -o $@ $<

readcpp: read.cpp
	$(CPP) $(CPPFLAGS) $(LIBSCPP) -static -I/usr/local/include/CCfits/ -o $@ $<

debugCPP: read.cpp
	$(CPP) $(CPPFLAGS) $(LIBSCPP) -D__DEBUG__ -I/usr/local/include/CCfits -g -o $@ $<	

image: image.cpp image.h
	$(CPP) $(CPPFLAGS) $(LIBSCPP) -I. -I/usr/local/root/include -I/usr/local/include/CCfits -o $@ $<

rw: rw.c
	$(CC) $(CFLAGS) $(LIBSC) -o $@ $<

clean:
	- rm -rf read readcpp debugC debugCPP image write
